var userCode;
var showInterfaceNum = 0;
var showMaxNum = 5;
var interfaceData = [];
var pageNumber = 0;
var pageSize = 20;
$(document)
		.ready(
				function() {
					// console.log('======================test1');
					// 存放选中的调度的领域接口的URL
					window.systemInterfaceUrl = null;
					// 存放选中的调度的运行状态
					window.runStatus = null;

					$('#win').window('close');
					$('#winToken').window('close');
					// 获取用户信息
					getCurrUserInfo();
					// 所属领域下拉框
					$('#comboxSearchfieldName')
							.combobox(
									{
										url : BASE_URL_FIELD_SEARCH
												+ '/findAllOfCurrentUserCanManage'
												+ '?v=' + Math.random(),
										valueField : 'id',
										textField : 'name',
										editable : false,
										method : 'get',
										loadFilter : function(data) {
											var allCheck = {
												'id' : '',
												'name' : '全部'
											};
											data.content.unshift(allCheck);
											return data.content;
										},
										onSelect : function(record) {
											comboxSearchSystemName
													.combobox(
															{
																disabled : false,
																method : 'get',
																queryParams : {
																	fieldId : record.id
																},
																url : BASE_URL_FIELD_SYSTEM_SEARCH
																		+ '/findByFieldOfCurrentUserCanManage'
																		+ '?v='
																		+ Math
																				.random(),
																valueField : 'id',
																textField : 'name',
																data : '',
																loadFilter : function(
																		data) {
																	var allCheck = {
																		'id' : '',
																		'name' : '全部'
																	};
																	data.content
																			.unshift(allCheck);
																	return data.content;
																},
																onLoadSuccess : function() {
																	comboxSearchSystemName
																			.combobox(
																					'setValue',
																					'');
																}
															}).load();
										},
										onLoadSuccess : function() {
											$('#comboxSearchfieldName')
													.combobox('setValue', '');
										}
									});

					// 所属系统下拉框 - 发布方
					var comboxSearchSystemName = $('#comboxSearchSystemName')
							.combobox({
								disabled : true,
								valueField : 'id',
								textField : 'name',
								editable : false,
								data : [ {
									id : '',
									name : '全部',
									'selected' : 'true'
								} ]
							});

					// 接口状态下拉框
					$('#comboxSearchInterfaceStatus').combobox(
							{
								url : BASE_URL_DATA_DICTIONARY_VALUE_SEARCH
										+ '/findByTypeCode?typeCode='
										+ DDTC_INTERFACE_STATUS + '&v='
										+ Math.random(),
								valueField : 'valueCode',
								textField : 'valueName',
								editable : false,
								method : 'get',
								loadFilter : function(data) {
									var allCheck = {
										'valueCode' : '',
										'valueName' : '全部'
									};
									data.unshift(allCheck);
									return data;
								}
							});

					$('#comboxPubField')
							.combobox(
									{
										url : BASE_URL_FIELD_SEARCH
												+ '/findAllFields' + '?v='
												+ Math.random(),
										valueField : 'id',
										textField : 'name',
										editable : false,
										method : 'get',
										loadFilter : function(data) {
											var allCheck = {
												'id' : '',
												'name' : '请选择'
											};
											if (data.content) {
												data.content.unshift(allCheck);
											} else {
												return data;
											}
											return data.content;
										},
										onSelect : function(record) {
											comboxPubSystem
													.combobox(
															{
																disabled : false,
																method : 'get',
																queryParams : {
																	fieldId : record.id
																},
																url : BASE_URL_FIELD_SYSTEM_SEARCH
																		+ '/findFieldSystemsByField'
																		+ '?v='
																		+ Math
																				.random(),
																valueField : 'id',
																textField : 'name',
																data : '',
																loadFilter : function(
																		data) {
																	var allCheck = {
																		'id' : '',
																		'name' : '请选择'
																	};
																	data.content
																			.unshift(allCheck);
																	return data.content;
																},
																onSelect : function(
																		record) {
																},
																onLoadSuccess : function(data) {
																	if(data==null || data.length!=2){
																		return;
																	}
																	// 如果系统只有一个，则默认选中该系统
																	$("#comboxPubSystem ").combobox('select', data[1].id);
																},
																onChange : function(
																		newValue,
																		oldValue) {
																	// $(
																	// '#datagrid4if')
																	// .datagrid(
																	// 'reload');
																	$(
																			'#tableInterface tbody')
																			.empty();
																	showInterfaceNum = 0;
																	getInterface(false);
																}
															}).load();
										},
										onChange : function(newValue, oldValue) {
											$("#comboxPubSystem").combobox(
													'setValue', '');
											// $('#datagrid4if')
											// .datagrid('reload');
											$('#tableInterface tbody').empty();
											showInterfaceNum = 0;
											getInterface(false);
										},
										onLoadSuccess : function(data) {
											if(data==null || data.length!=2){
												return;
											}
											// 如果领域只有一个，则默认选中该领域
											$("#comboxPubField ").combobox('select', data[1].id);
										}
									});

					var comboxPubSystem = $('#comboxPubSystem').combobox({
						disabled : true,
						valueField : 'id',
						textField : 'name',
						editable : false,
						url : '',
						data : [],
						loadFilter : function(data) {
							var allCheck = {
								id : '',
								name : '请选择',
								'selected' : 'true'
							};
							data.unshift(allCheck);
							return data;
						}

					});

					// for call system combobox
					// start======================================================
					$('#comboxCallField')
							.combobox(
									{
										url : BASE_URL_FIELD_SEARCH
												+ '/findAllOfCurrentUserCanManage'
												+ '?v=' + Math.random(),
										valueField : 'id',
										textField : 'name',
										editable : false,
										method : 'get',
										loadFilter : function(data) {
											var allCheck = {
												'id' : '',
												'name' : '请选择'
											};
											if (data.content) {
												data.content.unshift(allCheck);
											} else {
												return data;
											}
											return data.content;
										},
										onSelect : function(record) {
											//清空密钥
											$("#txtApplyKey").val('');
											comboxCallSystem
													.combobox(
															{
																disabled : false,
																method : 'get',
																queryParams : {
																	fieldId : record.id
																},
																url : BASE_URL_FIELD_SYSTEM_SEARCH
																		+ '/findByFieldOfCurrentUserCanManage'
																		+ '?v='
																		+ Math
																				.random(),
																valueField : 'id',
																textField : 'name',
																data : '',
																loadFilter : function(
																		data) {

																	var allCheck = {
																		'id' : '',
																		'name' : '请选择'
																	};
																	data.content
																			.unshift(allCheck);
																	return data.content;
																},
																onSelect : function(
																		record) {
																},
																onLoadSuccess : function(data) {
																	if(data==null || data.length!=2){
																		return;
																	}
																	// 如果系统只有一个，则默认选中该系统
																	$("#comboxCallSystem ").combobox('select', data[1].id);
																},
																onChange : function(
																		newValue,
																		oldValue) {
																	if (newValue == null
																			|| newValue == '') {
																		$("#txtApplyKey").val('');
																		return;
																	}	
																	getApplyKey();
																}
															}).load();
										},
										onLoadSuccess : function(data) {
											if(data==null || data.length!=2){
												return;
											}
											// 如果领域只有一个，则默认选中该领域
											$("#comboxCallField ").combobox('select', data[1].id);
										}

									});

					var comboxCallSystem = $('#comboxCallSystem').combobox({
						disabled : true,
						valueField : 'id',
						textField : 'name',
						editable : false,
						url : '',
						data : [],
						loadFilter : function(data) {
							var allCheck = {
								id : '',
								name : '请选择',
								'selected' : 'true'
							};
							data.unshift(allCheck);
							return data;
						}

					});

					// for call system combobox
					// end======================================================
					$("#datagrid")
							.datagrid(
									{
										url : BASE_URL_API
												+ '/serviceAccessApplication/getHttpInterfaceInfos?v='
												+ Math.random(),
										method : 'get',
										autoRowHeight : true,
										singleSelect : true,
										striped : true,
										nowrap : false,
										pageSize : 20,
										pageList : [ 10, 20, 50, 100 ],
										columns : [ [
												{
													field : 'callFieldName',
													title : '接口调用方领域',
													width : 25
												},
												{
													field : 'callSystemName',
													title : '接口调用方',
													width : 35
												},
												{
													field : 'appKey',
													title : '密钥',
													width : 30
												},
												{
													field : 'appDate',
													title : '生效日期',
													width : 25
												},
												{
													field : 'pubSystemName',
													title : '可调用的接口所属系统',
													width : 30
												},
												{
													field : 'names',
													title : '可调用的接口',
													width : 60,
													formatter : function(value,
															rowData, rowIndex) {
														var companent = "";
														$
																.each(
																		value,
																		function(
																				i,
																				item) {
																			if(i!=0){
																				companent+="<br/>";
																			}
																			companent += '<a href="javascript:void(0)" style="padding-bottom: 0px;margin-bottom: 50px" onclick="showDetial('
																					+ rowIndex
																					+ ','
																					+ i
																					+ ')">'
																					+ item
																					+ '</a>'
																		});
														return companent;
													}
												},
												{
													field : 'status',
													title : '状态',
													width : 10,
													formatter : function(value,
															rowData, rowIndex) {
														if (value == '0') {
															return "未生效";
														}
														return "生效";
													}
												},
												{
													field : '1',
													title : '操作',
													width : 23,
													formatter : function(value,
															rowData, rowIndex) {
														return '<div style="padding:5px 0;"><a href="javascript:void(0)" onclick="showTokenDetail('
																+ rowIndex
																+ ')"><img src="../../../../images/icons/view.png"  height="24" width="24"></a><a href="javascript:void(0)" onclick="emailToken('
																+ rowIndex
																+ ')"><img src="../../../images/icons/sendEmail.png"  height="24" width="24"></a><a href="javascript:void(0)" onclick="deleteToken('
																+ rowIndex
																+ ')"><img src="../../../images/icons/remove.png"  height="24" width="24"></a></div>';
													}
												} ] ],
										pagination : true,
										onSelect : function(rowIndex, rowData) {
											if (rowData.runStatusForDisplay == "暂停") {
												$(".startOrStop .l-btn-text")
														.text("重启");
												$(".startOrStop .icon-more")
														.css("background",
																"url(../../images/icons/restart.png) no-repeat center center");
											} else if (rowData.runStatusForDisplay == "正常") {
												$(".startOrStop .l-btn-text")
														.text("暂停");
												$(".startOrStop .icon-more")
														.css("background",
																"url(../../images/icons/stop.png) no-repeat center center");
											}
											$("#toolbar_edit").linkbutton(
													'enable');
											$("#toolbar_delete").linkbutton(
													'enable');
										},
										onUnselect : function() {
											$(".startOrStop .l-btn-text").text(
													"暂停/重启");
											$(".startOrStop .icon-more")
													.css("background",
															"url(../../images/icons/more.png) no-repeat center center");
										},
										loadFilter : function(data) {
											// alert("inData:"+JSON.stringify(data));
											return {
												total : data.totalElements,
												rows : data.content
											};
										},
										onBeforeLoad : function(param) {
											param.page -= 1;
											param.size = param.rows;
											delete param.rows;
											param.sort = 'appDate,desc';
										}
									});

					$(".panel-tool-close, #instance_cancel").click(function(e) {
						$("body").css("overflow-x", "inherit")
					});

				});

// 查询
function search() {
	$('#datagrid').datagrid('load');
}
function refresh() {
	$('#datagrid').datagrid('load');
}
function getCurrUserInfo() {
	$.ajax({
		type : "get",
		url : BASE_URL_USER_SEARCH + '/getCurrentUserInfo?v='
				+ Date.parse(new Date()),
		data : "",
		contentType : "application/json",
		success : function(result) {
			userCode = result.userCode;
			$("#txtUserCode").val(result.userCode);
			$("#labUserCode").text(result.userCode);
		},
		error : function() {
			$.messager.alert('错误', '<p>服务异常，获取当前用户信息失败!</p>', 'error');
		}
	});
}

function accessApplication() {
	// 初始化页码为0
	pageNumber = 0;
	// console.log('ok======================1');
	$('#addForm')[0].reset();
	$("#clearInterface").css("display", "none");
	$('input[name=qx]').attr('checked', true);
	$('#comboxCallSystem').combobox({
		disabled : true,
		valueField : 'id',
		textField : 'name',
		editable : false,
		url : '',
		data : [],
		loadFilter : function(data) {
			var allCheck = {
				id : '',
				name : '请选择',
				'selected' : 'true'
			};
			data.unshift(allCheck);
			return data;
		}
	});

	$('#comboxPubSystem').combobox({
		disabled : true,
		valueField : 'id',
		textField : 'name',
		editable : false,
		url : '',
		data : [],
		loadFilter : function(data) {
			if (data != null && data.length > 0 && data[0].name == '请选择') {
				return data;
			}
			var allCheck = {
				id : '',
				name : '请选择',
				'selected' : 'true'
			};
			data.unshift(allCheck);
			return data;
		}
	});
	
	var data = $('#comboxPubField').combobox('getData');

	$("#comboxPubField").combobox('setValue', data[0].id);
	$("#comboxCallField").combobox('setValue', data[0].id);
	$("#labUserCode").text($("#txtUserCode").val());
	$('#tableInterface tbody').empty();
	// console.log('ok======================2');
//	setTimeout(function() {
//		$("#comboxPubField").siblings(".textbox").children(".textbox-text")
//				.val($("#comboxPubField").combobox('getText'));
//		$('#comboxPubSystem').combobox({
//			disabled : true,
//			valueField : 'id',
//			textField : 'name',
//			editable : false,
//			url : '',
//			data : [],
//			loadFilter : function(data) {
//				var allCheck = {
//					id : '',
//					name : '请选择',
//					'selected' : 'true'
//				};
//				data.unshift(allCheck);
//				return data;
//			}
//		});
//		$("#comboxCallField").siblings(".textbox").children(".textbox-text")
//				.val($("#comboxCallField").combobox('getText'));

//		$('#comboxCallSystem').combobox({
//			disabled : true,
//			valueField : 'id',
//			textField : 'name',
//			editable : false,
//			url : '',
//			data : [],
//			loadFilter : function(data) {
//				var allCheck = {
//					id : '',
//					name : '请选择',
//					'selected' : 'true'
//				};
//				data.unshift(allCheck);
//				return data;
//			}
//		});
//
//		
//		// console.log('ok======================3');
//
//	}, 50);
	// //console.log('ok======================4');

	$("#comboxPubField").combobox({
		disabled : false
	});
	$("#comboxCallField").combobox({
		disabled : false
	});
	$("#comboxPubSystem").combobox({
		disabled : false
	});
	$("#instance_apply").css("display", "inline-block");
	$('#win').window('setTitle', '服务接入申请');
	$('#win').window('open');
}

function accApplication() {
	var pubField = $('#comboxPubField').combobox('getValue');
	var pubSystem = $('#comboxPubSystem').combobox('getValue');
	var interfaces = [];
	$("input:checkbox[name='chbSelInterface']:checked").each(function(i) {
		interfaces[i] = $(this).val() + "";
	});
	if (interfaces == null || interfaces.length == 0) {
		$.messager.alert('警告', "<p>请选接口!</p>", "warning");
		return;
	}
	var interfaces = JSON.stringify(interfaces);
	var callField = $('#comboxCallField').combobox('getValue');
	var callSystem = $('#comboxCallSystem').combobox('getValue');
	var applyKey = $("#txtApplyKey").val();
	var whiteList = $("#txtAreaIpWhiteList").val();
	var data = '{"pubFieldId":"' + pubField + '","pubSystemId":"' + pubSystem
			+ '" ,' + '"callFieldId":"' + callField + '","callSystemId":"'
			+ callSystem + '" ,' + '"interfaces":' + interfaces
			+ ',"applyKey":"' + applyKey + '","whiteList":"' + whiteList + '"}';
	$("#buttons_inport .easyui-linkbutton").linkbutton("disable");
	$("#buttons_inport .l-btn-text").text("请等待...");
	$('#progressbar_tips').show();
	$('#progressbar').show();
	$
			.ajax({
				type : "post",
				url : BASE_URL_API
						+ '/serviceAccessApplication/accessApplication?v='
						+ Math.random(),
				dataType : 'json',
				data : data,
				contentType : "application/json",
				success : function(data) {
					$('#progressbar').hide();
					$('#progressbar_tips').hide();// 加载进度图隐藏
					if (data.result == '1') {
						// $("#errormsg").html("ok").hide(3000);
						$('#win').window('close');
						$.messager.alert('提示', '<p>服务接入申请成功!</p>', 'info');
						setTimeout(
								function() {
									$("#datagrid")
											.datagrid(
													"reload",
													BASE_URL_API
															+ '/serviceAccessApplication/getHttpInterfaceInfos?v='
															+ Date
																	.parse(new Date()));
								}, 100);
					} else {
						$.messager.alert('错误', '<p>' + data.msg + '</p>',
								'error');
					}
				},
				error : function() {
					$('#progressbar').hide();
					$('#progressbar_tips').hide();// 加载进度图隐藏
					$.messager.alert('错误', '<p>服务异常，服务接入申请失败，请稍后重试或联系管理员!</p>',
							'error');
				}
			});
}
function rePage() {
	$("#instance_apply").css("display", "inline-block");
	$("#instance_save").css("display", "inline-block");
	$('#win').window('close');
}

function rePageToken() {
	$('#winToken').window('close');
}

function getApplyKey() {
	var callSystem = $('#comboxCallSystem').combobox('getValue');
	if (callSystem == "") {
		$.messager.alert('警告', '<p>接口调用方不能为空!</p>', 'warning');
		return;
	}
	var jsonData = {
		callSystem : callSystem
	};
	$.ajax({
		type : "get",
		url : BASE_URL_API + '/serviceAccessApplication/getApplyKey?v='
				+ Math.random(),
		dataType : 'json',
		data : jsonData,
		contentType : "application/json",
		success : function(data) {
			$("#txtApplyKey").val(data.key);
		},
		error : function() {
			$.messager.alert('错误', '<p>服务异常，获取密钥失败，请稍后重试或联系管理员!</p>', 'error');
		}
	});
}

function showDetial(rowIndex, itemIndex) {
	var row = $('#datagrid').datagrid('getData').rows[rowIndex];
	var interfaceId = row.ifIds[itemIndex];
	var interfaceName = row.names[itemIndex];
	var title = "服务浏览";
	var url = "/pages/esb/ServiceManagement/businessServiceView.html?interfaceId="
			+ window.encodeURI(interfaceId) + '&interfaceName=' + window.encodeURI(interfaceName) + '&v=' + Math.random();
	;
	var icon = $(this).attr("icon");
	window.parent.OpenTab(title, url, icon, true);
}

function showTokenDetail(rowIndex) {

	var row = $('#datagrid').datagrid('getData').rows[rowIndex];
	var names = (row.names + "").split(",");
	$('#tableInterfaceDetial tbody').empty();
	var table = $("#tableInterfaceDetial");
	for (var i = 0; i < names.length;) {
		var trHTML = '<tr><td  style="width: 5px; "><input style="width: 15px;height: 15px;" checked="true" type="checkbox" disabled="true"  '
				+ ' name="chb"/></td><td align="left"  style="width: 50px;height: 15px;word-break:break-all; word-wrap:break-word;"><label>'
				+ names[i] + '</label></td>';
		i += 1;

		if (i < names.length) {
			trHTML += '<td   style="width: 5px; "><input style="width: 15px;height: 15px;" checked="true" disabled="true"   type="checkbox" '
					+ ' name="chb"/></td><td align="left"   style="width: 50px;height: 15px;word-break:break-all; word-wrap:break-word;"><label>'
					+ names[i] + '</label></td>';
			i += 1;
		}
		trHTML += '</tr>';
		table.append(trHTML);
	}
	// $("#labInterfaceToken").text(names.replace(re, "<br/>"));
	$("#txtCallFieldToken").val(row.callFieldName);
	$("#txtCallSystemToken").val(row.callSystemName);
	$("#txtPubFieldToken").val(row.pubFieldName);
	$("#txtPubSystemToken").val(row.pubSystemName);
	$("#txtApplyKeyToken").val(row.appKey);
	$("#txtAreaIpWhiteListToken").val(row.whiteList);
	$("#labUserCodeToken").text($("#txtUserCode").val());
	$('#winToken').window('setTitle', '查看令牌');
	$('#winToken').window('open');
}

//发送邮件
function emailToken(rowIndex){
	var row = $('#datagrid').datagrid('getData').rows[rowIndex];
	if(row.status == '1' || row.status == '2'){
		$.messager.alert('警告', '<p>申请的密钥已经生效，无须再发送邮件!</p>', 'warning');
		return;
	}
	var jsonData = {
		id :row.id,
		callFieldName : row.callFieldName,
		callSystemName : row.callSystemName,
		pubFieldName : row.pubFieldName,
		pubSystemName : row.pubSystemName,
		ifIds : row.ifIds,
		names : row.names,
		status : row.status
	};
	
	$("#buttons_inport .easyui-linkbutton").linkbutton("disable");
	$("#buttons_inport .l-btn-text").text("请等待...");
	$('#progressbar_tips').show();
	$('#progressbar').show();
	$.ajax({
		type : "post",
		url : BASE_URL_API + '/serviceAccessApplication/emailToken?v='
				+ Math.random(),
		data : JSON.stringify(jsonData),
		contentType : "application/json",
		success : function(data) {
			$('#progressbar').hide();
			$('#progressbar_tips').hide();// 加载进度图隐藏			
			if (data.backValue == true) {
				$.messager.alert('提示', "<p>发送邮件成功!</p>", 'info', function() {
					
				});
			} else {
				$.messager.alert('错误', '<p>发送邮件失败!</p>', 'error');
			}
			
			$("#datagrid").datagrid("reload");
		},
		error : function() {
			$('#progressbar').hide();
			$('#progressbar_tips').hide();// 加载进度图隐藏			
			$.messager.alert('错误', '<p>发送邮件失败!</p>', 'error');
			$("#datagrid").datagrid("reload");
		}
	});
}

function deleteToken(rowIndex) {
	$.messager.confirm('温馨提示', '<p>你真的要删除么?</p>', function(result) {
		if (result) {
			var row = $('#datagrid').datagrid('getData').rows[rowIndex];
			var jsonData = {
				ids : row.ids
			};
			var ids = "";
			$.each(row.ids, function(index, item) {
				ids += item + ",";
			});
			ids = ids.substring(0, ids.length - 1);
			ids += "";
			var data = {
				ids : ids
			};
			$.ajax({
				type : "get",
				url : BASE_URL_API + '/serviceAccessApplication/deleteToken?v='
						+ Math.random(),
				dataType : 'json',
				data : data,
				contentType : "application/json",
				success : function(data) {
					if (data.result = '1') {
						$.messager.alert('提示', "<p>删除成功!</p>", 'info', function() {
							window.location.reload();
						});
					} else {
						$.messager.alert('错误', '<p>' + data.msg + '!</p>', 'error');
					}
				},
				error : function() {
					$.messager.alert('错误', '<p>服务异常，删除密钥失败，请稍后重试或联系管理员!</p>', 'error');
				}
			});
		}
	});

}

function getInterface(flag) {
	var callSystemId = $('#comboxCallSystem').combobox('getValue');
	var pubSystemId = $('#comboxPubSystem').combobox('getValue');
	var data = '{"callSystemId":"' + callSystemId + '","pubSystemId":"'
			+ pubSystemId + '" ,"pubSystemId":"' + pubSystemId + '" ,'
			+ '"pageNumber":' + (pageNumber * pageSize) + ',"pageSize":'
			+ pageSize + '}';
//	$("#buttons_inport .easyui-linkbutton").linkbutton("disable");
//	$("#buttons_inport .l-btn-text").text("正在加载中...");
//	$('#progressbar_tips').show();
//	$('#progressbar').show();
	$.ajax({
		type : "post",
		url : BASE_URL_API
				+ '/serviceAccessApplication/getAvailableInterface4Page?v='
				+ Math.random(),
		dataType : 'json',
		data : data,
		contentType : "application/json",
		success : function(data) {
			//$('#progressbar').hide();
			//$('#progressbar_tips').hide();// 加载进度图隐藏
			// interfaceData = data;
			updateInterfaceTable(data.value, false);
		},
		error : function() {
			//$('#progressbar').hide();
			//$('#progressbar_tips').hide();// 加载进度图隐藏
			$.messager.alert('错误', '<p>服务异常，删除密钥失败，请稍后重试或联系管理员!</p>', 'error');
		}
	});
}

function updateInterfaceTable(data, flag) {
	var table = $("#tableInterface");
	if (data == null || data == '' || data.length <= 0) {
		return;
	}
	for (var i = 0; i < data.length;) {
		var trHTML = '<tr><td  style="width: 5px; "><input style="width: 15px;height: 15px;" type="checkbox" value='
				+ data[i].id
				+ ' name="chbSelInterface"/></td><td align="left"  style="width: 50px;height: 15px;word-break:break-all; word-wrap:break-word;"><label>'
				+ data[i].name + '</label></td>';
		i += 1;

		if (i < data.length) {
			trHTML += '<td   style="width: 5px; "><input style="width: 15px;height: 15px;" type="checkbox" value='
					+ data[i].id
					+ ' name="chbSelInterface"/></td><td align="left"   style="width: 50px;height: 15px;word-break:break-all; word-wrap:break-word;"><label>'
					+ data[i].name + '</label></td>';
			i += 1;
		}
		trHTML += '</tr>';
		table.append(trHTML);
	}
}
function showMore() {
	//页码加1
	pageNumber+=1;
	getInterface(true);
}
